From ecb1cad872e885ddfb85101498a3b28dceb5ac36 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sun, 20 Sep 2009 21:24:48 +0000 Subject: [PATCH] Follow-ups to r56684: add a member function for extensions to add header text cleanly, and tweak variable names in api/ApiLogin.php. --- includes/api/ApiLogin.php | 4 ++-- includes/specials/SpecialCreateAccount.php | 10 ++++++++++ includes/specials/SpecialUserlogin.php | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/includes/api/ApiLogin.php b/includes/api/ApiLogin.php index f2a96aa043..45b3604bdc 100644 --- a/includes/api/ApiLogin.php +++ b/includes/api/ApiLogin.php @@ -68,8 +68,8 @@ class ApiLogin extends ApiBase { wfSetupSession(); } - $loginForm = new Login( $req ); - switch ( $authRes = $loginForm->attemptLogin() ) { + $login = new Login( $req ); + switch ( $authRes = $login->attemptLogin() ) { case Login::SUCCESS : global $wgUser, $wgCookiePrefix; diff --git a/includes/specials/SpecialCreateAccount.php b/includes/specials/SpecialCreateAccount.php index ccd394c00d..fbc289920c 100644 --- a/includes/specials/SpecialCreateAccount.php +++ b/includes/specials/SpecialCreateAccount.php @@ -502,6 +502,16 @@ class SpecialCreateAccount extends SpecialPage { } } + /** + * Add text to the header. Only write to $mFormHeader directly + * if you're determined to overwrite anything that other + * extensions might have added. + * @param $text String HTML + */ + public function addFormHeader( $text ){ + $this->mFormHeader .= $text; + } + /** * Since the UserCreateForm hook was changed to pass a SpecialPage * instead of a QuickTemplate derivative, old extensions might diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 3a54f0132d..d706a55a6f 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -540,6 +540,16 @@ class SpecialUserLogin extends SpecialPage { return; } } + + /** + * Add text to the header. Only write to $mFormHeader directly + * if you're determined to overwrite anything that other + * extensions might have added. + * @param $text String HTML + */ + public function addFormHeader( $text ){ + $this->mFormHeader .= $text; + } /** * Since the UserLoginForm hook was changed to pass a SpecialPage -- 2.20.1